Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry GET from Redis for messages in the Execution Graph #181

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

csegarragonz
Copy link
Collaborator

@csegarragonz csegarragonz commented Nov 25, 2021

In this PR I fix a race condition that happened when running Scheduler::getFunctionExecGraph() immediately after Scheduler::getFunctionResult() in a distributed setting.

In particular, we sometimes generated the execution graph before all remote executors had published their resulting message. As a consequence, redis.get would return an empty byte array, and we'd cast it to an empty faabric::Message.

I add a naive retry mechanism (bear in mind generating execution graphs is off the hot path), and a test that reproduces the failure with very little retries (in fact 10 tries might be an overkill).

@csegarragonz csegarragonz added the bug Something isn't working label Nov 25, 2021
@csegarragonz csegarragonz self-assigned this Nov 25, 2021
src/scheduler/Scheduler.cpp Outdated Show resolved Hide resolved
src/scheduler/Scheduler.cpp Show resolved Hide resolved
REQUIRE(node.msg.id() == req->mutable_messages()->at(i).id());
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test isn't checking that it will fail when the max retries are hit, which seems like the easier case to check for.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add another test that checks that you can't get an execution graph for a message that hasn't been published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants